Repository navigation
feat(codemod): add props unification functions - #87
Open
LinKCoding wants to merge 4 commits into
Open
LinKCoding wants to merge 4 commits into
LinKCoding wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Renames Select sizeVariant to size and converts size values to sm/md/lg and left/right alignment values to start/end on Gamut components, scoped to components imported from @skillsoft/gamut. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…clarations size-and-alignment now converts string literals in either branch of a ternary, and rewrites the string-literal union and literal default of a prop type when the file passes that prop to a Gamut component. Warnings for values that can't be converted name where the value is declared, and the CLI prints them grouped by file. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-codemods
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kl-gmt-1872-props-unification-size #87 +/- ##
======================================================================
+ Coverage 77.23% 77.44% +0.20%
======================================================================
Files 464 467 +3
Lines 32083 32417 +334
Branches 1467 1597 +130
======================================================================
+ Hits 24778 25104 +326
- Misses 7304 7306 +2
- Partials 1 7 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ops-unifications-codemod Keep variant="blue" in the ProgressBar sizes fixture output. ProgressBar defaults to the 'default' variant, so the codemod must not drop an explicit variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a
size-and-alignmentpreset to@skillsoft/gamut-codemodsthat moves consumer code onto the new size and alignment values, and makes ProgressBar'svariantprop optional.prop-valuesmigration: renames Select'ssizeVarianttosize(small→sm,base→md) and converts size values on Button, Input, Toggle, SelectDropdown, ProgressBar, Badge, DatePicker'sinputSize, FormGroup and ConnectedFormGrouplabelSize, and FormGroupLabelsize.left/rightbecomestart/endforiconPosition,buttonPlacement,alignContentContainer,openFrom,menuAlignment, Popoveralignandbeak, Coachmarkbeak, and GridFormlayout. Tip and PopoverContaineralignmentvalues liketop-leftmap to theirstart/endforms.@skillsoft/gamutare rewritten, so aliased imports work and local components with the same name are left alone.src/presets/size-and-alignment/manifest.ts, typed byComponentPropChangesinsrc/lib/manifest.ts.run-source.tsandtransform.test.tspick up the preset.TexttextAlign, GridForm fieldposition, props read from variables).variantis optional and defaults todefault.PR Checklist
Testing Instructions
Don't make me tap the sign.
yarn nx test gamut-codemods. The fixture cases forprop-valuesshould pass, and each output should be unchanged when run a second time.@skillsoft/gamut:npx @skillsoft/gamut-codemods size-and-alignment . --dry. Confirm the diff renamessizeVarianttosizeand mapssmall/baseandleft/rightas the README describes.Status/ProgressBarin Storybook and the ProgressBar docs. Confirm<ProgressBar percent={50} />renders with thedefaultvariant and novariantprop is required.PR Links and Envs
🤖 Generated with Claude Code